define(function( require ) {
    var Marionette = require('marionette');

    var tpl = require('text!components/image/1.0.0/templates/image_upload_item.html');
    return Marionette.ItemView.extend({
        template: _.template(tpl),
        tagName: 'li',
        className: 'upload-preview-img sort',
        events: {
            'click .js-remove-image': 'removeImage'
        },
        removeImage: function() {
            this.model.destroy();
            window.NC.trigger('image:number:change');
        }
    });
});